/*******************************************************************
 *
 * Copyright (C), 2021-2022, LS, All rights reserved.
 *
 * Author      : 
 * Create Time : 2020-11-02
 * Version     : v0.1
 * Description : 
 *******************************************************************/

/*----------------------------Head file----------------------------*/
#include "pwrmgr.h"
#include "app_pwr_mgr.h"
#include "bsp_hw_config.h"


/*----------------------------macro file---------------------------*/
#define APP_PWR_MGR_EN      1

#if APP_PWR_MGR_EN
#include "log.h"
#define PWR_MGR_LOG         LOG
#else
#define PWR_MGR_LOG(...)
#endif

/*----------------------------type define--------------------------*/

/*-------------------------func declarative------------------------*/

/*----------------------------var define---------------------------*/

/*-----------------------------------------------------------------*/

void app_pwr_mgr_init(void)
{
    //Note: TFT display need MCU in no sleep mode.
    hal_pwrmgr_register(MOD_USR2, NULL, NULL);
}


void app_pwr_mgr_enter_sleep(void)
{
    PWR_MGR_LOG("enter_sleep.\n");
    hal_pwrmgr_unlock(MOD_USR2);
}


void app_pwr_mgr_exit_sleep(void)
{
    PWR_MGR_LOG("exit_sleep.\n");
    hal_pwrmgr_lock(MOD_USR2);
}

